<tr>    
    <td><?php            
    echo  CHtml::activeTextField($model, '[' . $index . ']name', array('readonly'=>true));
    ?></td>			    
    <td ><?php            
    echo  CHtml::activeTextField($model, '[' . $index . ']file_name', array('readonly'=>true));
    ?></td>       
    <td class="hideonview"><?php
    echo CHtml::link('X', '#', array('onclick' => 'deleteAttachment(this, ' . $index . ', '. $model->id .'); return false;', 'class' => 'hiddenOnView'));
    ?></td>
</tr>

<?php
//Yii::app()->clientScript->registerScript('deleteProcess', "
//function deleteAttachment(elm, index)
//{
//    element=$(elm).parent().parent();
//    /* animate div */    
//    $(element).remove();    
//}", CClientScript::POS_END);
?>
<script type="text/javascript">
function deleteAttachment(elm, index, id)
{
	$.ajax({
        url: '<?php echo url('/advanceprofile/deleteattachment/');?>?id='+id,
        success: function(){   
        	element=$(elm).parent().parent();
            /* animate div */    
            $(element).remove();  	                  	      		           		             
        }
    });
}
</script>
